<!DOCTYPE html>
<html>
<!-- 待设培训计划员工-详情 -->

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
        <script src="/static/js/common.js"></script>

</head>

<body>
    <div id="app" class="popupW100" v-cloak>
        <el-form label-position="right" :model="Form" status-icon :rules="rules" ref="ruleForm" label-width="100px"
            size="mini">
            <el-col class="head-tool">
                基础信息
            </el-col>
            <el-row style="width:50%;float:left;">
                <el-col :span="24">
                    <div class="elst-select-mini">
                        <el-form-item prop="Employeeregister">
                            <el-input type="text" v-model="Form.Employeeregister" autocomplete="off" size="mini"
                                disabled="true">
                                <template slot="prepend">
                                    {{Stafftobetrained.Employeeregister+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>

                <el-col :span="24">
                    <div class="elst-select-mini">
                        <el-form-item prop="Dateofentry">
                            <el-input type="text" v-model="Form.Dateofentry" autocomplete="off" size="mini"
                                disabled="true">
                                <template slot="prepend">
                                    {{Stafftobetrained.Dateofentry+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
                <el-col :span="24">
                    <div class="elst-select-mini">
                        <el-form-item prop="Dateofbirth">
                            <el-input type="text" v-model="Form.Dateofbirth" autocomplete="off" size="mini"
                                disabled="true">
                                <template slot="prepend">
                                    {{Stafftobetrained.Dateofbirth+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
                <el-col :span="24">
                    <div class="elst-select-mini">
                        <el-form-item prop="Subordinatedepartments">
                            <el-input type="text" v-model="Form.Subordinatedepartments" autocomplete="off" size="mini"
                                disabled="true">
                                <template slot="prepend">
                                    {{Stafftobetrained.Subordinatedepartments+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
                <el-col :span="24">
                    <div class="elst-select-mini">
                        <el-form-item prop="Engagedinwork">
                            <el-input type="text" v-model="Form.Engagedinwork" autocomplete="off" size="mini"
                                disabled="true">
                                <template slot="prepend">
                                    {{Stafftobetrained.Engagedinwork+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
                <el-col :span="24">
                    <div class="elst-select-mini">
                        <el-form-item prop="Positionandposition">
                            <el-input type="text" v-model="Form.Positionandposition" autocomplete="off" size="mini"
                                disabled="true">
                                <template slot="prepend">
                                    {{Stafftobetrained.Positionandposition+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
                <el-col :span="24">
                    <div class="elst-select-mini">
                        <el-form-item prop="Phonenumber">
                            <el-input type="text" v-model="Form.Phonenumber" autocomplete="off" size="mini"
                                disabled="true">
                                <template slot="prepend">
                                    {{Stafftobetrained.Phonenumber+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>



            </el-row>
            <el-row style="width:35%;float:left;margin-left:40px;">
                <el-col :span="24">
                    <div class="elst-select-mini">
                        <div class="el-input-group__prepend"
                            style="font-size:12px;float:left;line-height:24px;background:none;border:0;color:#000;padding-left:10px!important;">
                            {{Stafftobetrained.photo+mark.m}}
                        </div>
                        <img src="/static/images/Client.png" style="width:150px;height:150px;" />

                    </div>
                </el-col>
                <el-col :span="24" style="margin-top:10px;">
                    <div class="elst-select-mini">
                        <el-form-item prop="Gender">
                            <el-input type="text" v-model="Form.Gender" autocomplete="off" size="mini" disabled="true">
                                <template slot="prepend">
                                    {{Stafftobetrained.Gender+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>

                <el-col :span="24">
                    <div class="elst-select-mini">
                        <el-form-item prop="Dualheadquartersstaff">
                            <label for="Dualheadquartersstaff" class="el-form-item__label fl"
                                style="width: 100px;">{{Stafftobetrained.Dualheadquartersstaff+mark.m}}</label>
                            <span v-if="Form.Dualheadquartersstaff>='是'">
                                <el-checkbox v-model="checked"></el-checkbox>
                            </span>
                            <span v-else>
                                <el-checkbox v-model="checkedN"></el-checkbox>
                            </span>
                            <!-- </template> -->
                        </el-form-item>
                    </div>
                </el-col>
            </el-row>
            <el-row>
                <el-col class="head-tool">
                    HSE管理信息
                </el-col>
                <el-col :span="24" style="font-size:12px;">
                    <div class="elst-select-mini">
                        <el-form-item prop="Whethertojointhetraining">
                            <label for="Whethertojointhetraining" class="el-form-item__label"
                                style="width: 145px!important;">{{Stafftobetrained.Whethertojointhetraining+mark.m}}</label>
                            <!-- <span>{{Form.Whethertojointhetraining}}</span> -->
                            <span v-if="Form.Whethertojointhetraining>='是'">
                                已加入
                            </span>
                            <span v-else>
                                <span prop="Dualheadquartersstaff" v-model="Form.Gender"></span>未加入
                                <!-- <el-button type="primary" style="margin-left:15px;">
                                    {{col.btnJointhetraining}}</el-button> -->
                                <el-button type="primary" @click="addDualheadquartersstaff" style="margin-left:15px;">
                                    {{col.btnJointhetraining}}</el-button>
                            </span>
                        </el-form-item>


                        <!-- <div class="el-input-group__prepend"
                            style="font-size:12px;float:left;line-height:24px;background:none;border:0;color:#000;padding-left:10px!important;">
                            {{Stafftobetrained.Dualheadquartersstaff+mark.m}}
                        </div>
                        <span prop="Dualheadquartersstaff" v-model="Form.Gender"></span>未加入<el-button type="primary"
                            @click="onSubmit" style="margin-left:15px;">{{col.btnJointhetraining}}</el-button> -->

                    </div>
                </el-col>
                <el-col :span="24" style="margin-top:15px;">
                    <div class="elst-select-mini">
                        <div class="el-input-group__prepend"
                            style="font-size:12px;float:left;line-height:24px;background:none;border:0;color:#000;padding-left:10px!important;">
                            {{Stafftobetrained.GuaranteeCard+mark.m}}
                        </div>
                        <el-button type="primary" @click="onSubmit" style="margin-left:15px;">
                            {{col.btnClickontheEditor}}</el-button>

                    </div>
                </el-col>
                <el-col :span="24" style="margin-top:15px;">
                    <img src="/static/images/tp.jpg" style="width:600px;height:150px;" />
                </el-col>
            </el-row>
            <el-row type="flex" justify="end">
                <el-form-item>
                    <el-button type="primary" @click="onSubmitForm('ruleForm')">{{col.btnclose}}</el-button>
                </el-form-item>
            </el-row>
        </el-form>
    </div>
    <script type="text/javascript">

        var app = new Vue({

            el: '#app',
            data: {
                //父业传参
                id: '',
                checked: true,
                checkedN: false,
                ListItem: ListItem,
                Whethertojointhetraining: '',
                formInline: {
                    model: { hiddenTroubleClass: '', headOperations: '' },
                    offset: 0,
                    limit: 10
                },
                //业务表单内容
                Form: {
                    id: guidEmpty,
                    loginName: '',
                    name: '',
                    password: '',
                    sex: '',
                    remarks: '',
                },
                //表单验证
                rules: {
                    loginName: [
                        verification.NotNull,
                        { pattern: verification.StringLengthAtoB.t.format(2, 10), message: verification.StringLengthAtoB.m.format(5, 10), trigger: 'blur' }
                    ],
                    password: [
                        verification.NotNull

                    ],
                    sex: [
                        verification.NotNullSelect
                    ],
                    name: [
                        verification.NotNull
                    ]
                }
            },
            methods: {
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },
                //获取分页数据
                GetPageData: function (currentIndex) { GetPageData(this, currentIndex, '/api/Stafftobetrained/GetList') },
                //查询方法
                onSubmit: function () { onSubmit(this); },
                btnUpLoad: function () {
                    this.$message({
                        message: '上传成功',
                        type: 'success'
                    });
                },
                //提交数据
                onSubmitForm: function (formName) {
                    var mythis = this;
                    this.$refs[formName].validate(function (valid) {
                        //验证通过
                        if (valid) {
                            onSubmitForm(this, '/api/Stafftobetrained/Save', mythis.Form);
                        } else {
                            //验证失败
                            return false;
                        }
                    });
                },
                getData: function () {
                    getData(this, '/api/Stafftobetrained/get?id=' + this.id);
                },

                //删除方法
                onDelete: function () { onDelete(this, '/api/Stafftobetrained/DeleteMuti'); },
                //列表选择触发
                handleSelectionChange: function (val) { handleSelectionChange(this, val); },
                //获取分页数据
                GetPageData: function (currentIndex) { GetPageData(this, currentIndex, '/api/Stafftobetrained/GetList') },
                //pagesize改变 触发方法
                handleSizeChange: function (val) { handleSizeChange(this, val); },
                //跳页触发方法
                handleCurrentChange: function (val) { handleCurrentChange(this, val); },
                addDualheadquartersstaff:function(){ this.Form.Whethertojointhetraining='是' }
            },
            mounted: function () {
                //初始化数据
                this.GetPageData(1);
                //列表高度自适应
                tablehigh(this);
                this.id = getUrlParam("id");
                this.getData();
                //获取下拉菜单内容
                this.hiddenTroubleClass = getDicData('59');
                this.YNFinish = getDicData('50');
            }
        });
    </script>
</body>

</html>